﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:Interactivity="using:Microsoft.Xaml.Interactivity" xmlns:Core="using:Microsoft.Xaml.Interactions.Core">

    <!-- Item Panel Templates -->
    <ItemsPanelTemplate x:Key="VerticalStackPanelItemTemplate">
        <StackPanel Orientation="Vertical" />
    </ItemsPanelTemplate>


    <DataTemplate x:Key="AWShopperItemTemplate">
        <Grid>
            <Grid.RowDefinitions>
                <RowDefinition Height="*" />
                <RowDefinition Height="100" />
            </Grid.RowDefinitions>
            <Image Stretch="UniformToFill"
                   Source="{Binding Image}"
                   VerticalAlignment="Center"
                   HorizontalAlignment="Center"
                   AutomationProperties.Name="{Binding Title}"/>
            <StackPanel VerticalAlignment="Bottom"
                        Grid.Row="1"
                        Background="{StaticResource ListViewItemOverlayBackgroundThemeBrush}"
                        Height="100">
                <TextBlock Text="{Binding SalePrice}"
                           Foreground="White"
                           FontSize="26"
                           Margin="15,0,15,0"
                           FontWeight="ExtraBold"/>
                <TextBlock Text="{Binding Title}"
                           Foreground="{StaticResource ListViewItemOverlayForegroundThemeBrush}"
                           Style="{StaticResource TitleTextStyle}"
                           TextWrapping="NoWrap"
                           Margin="15,0,15,0"/>
                <TextBlock Text="{Binding Description}"
                           Foreground="{StaticResource ListViewItemOverlaySecondaryForegroundThemeBrush}"
                           Style="{StaticResource CaptionTextStyle}"
                           TextWrapping="NoWrap"
                           Margin="15,0,15,10"/>
            </StackPanel>
        </Grid>
    </DataTemplate>

    <DataTemplate x:Key="AWShopperItemTemplateSemanticZoom">
        <Grid>
            <Grid.RowDefinitions>
                <RowDefinition Height="*" />
                <RowDefinition Height="100" />
            </Grid.RowDefinitions>
            <Image Stretch="UniformToFill"
                   Source="{Binding Group.Image}"/>
            <StackPanel Background="{StaticResource ListViewItemOverlayBackgroundThemeBrush}"
                        Grid.Row="1"
                        Height="100">
                <TextBlock Text="{Binding Group.Title}"
                           TextTrimming="WordEllipsis"
                           FontSize="26"
                           FontWeight="ExtraBold"
                           Margin="10"/>
                <StackPanel Orientation="Horizontal"
                            Margin="10,0,10,0"
                            HorizontalAlignment="Left">
                    <TextBlock Text="{Binding Group.TotalNumberOfItems}"
                               FontSize="20"/>
                    <TextBlock Text="Products"
                               Margin="10,0,10,0"
                               FontSize="20"
                               HorizontalAlignment="Center"/>
                </StackPanel>
            </StackPanel>
        </Grid>
    </DataTemplate>

    <DataTemplate x:Key="ShoppingCartItemTemplate">
        <Grid Margin="0"
              MinWidth="355"
              Height="165"
              Background="{StaticResource AWShopperItemBackgroundBrush}">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="134" />
                <ColumnDefinition />
            </Grid.ColumnDefinitions>
            <Image Source="{Binding Image}"
                   Grid.Column="0"
                   Width="114"
                   Height="114"
                   Margin="10" />
            <Grid Grid.Column="1">
                <Grid.RowDefinitions>
                    <RowDefinition Height="45" />
                    <RowDefinition />
                    <RowDefinition Height="60" />
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition />
                    <ColumnDefinition Width="60" />
                </Grid.ColumnDefinitions>
                <TextBlock Text="{Binding Title}"
                           Grid.Row="0"
                           TextWrapping="Wrap"
                           Grid.ColumnSpan="2"
                           Margin="3"></TextBlock>
                <TextBlock Text="{Binding Description}"
                           Grid.Row="1"
                           Foreground="White"
                           Margin="3"
                           Grid.ColumnSpan="2"
                           TextWrapping="Wrap"
                           TextTrimming="WordEllipsis"></TextBlock>
                <Grid Grid.Row="2"
                      Grid.Column="0">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto" />
                        <ColumnDefinition />
                    </Grid.ColumnDefinitions>
                    <TextBlock Grid.Column="0"
                               Text="{Binding DiscountedPrice}"
                               Margin="3"
                               VerticalAlignment="Bottom"
                               FontSize="22"></TextBlock>
                    <Grid Grid.Column="1"
                          Height="25"
                          HorizontalAlignment="Center"
                          VerticalAlignment="Bottom">
                        <Line Stretch="Fill"
                              Stroke="Gray"
                              StrokeThickness="2"
                              X1="1"
                              VerticalAlignment="Center"
                              HorizontalAlignment="Center" />
                        <TextBlock Text="{Binding FullPrice}"
                                   Margin="3"
                                   VerticalAlignment="Bottom"
                                   HorizontalAlignment="Center"
                                   FontSize="14"
                                   Foreground="White"></TextBlock>
                    </Grid>
                </Grid>
                <Border Grid.Row="2"
                        Grid.Column="1"
                        Width="50"
                        Height="50"
                        CornerRadius="50"
                        Background="{StaticResource AWShopperItemDarkerBackgroundBrush}">
                    <Grid>
                        <Grid.RowDefinitions>
                            <RowDefinition />
                            <RowDefinition />
                        </Grid.RowDefinitions>
                        <TextBlock x:Uid="Quantity"
                                   Grid.Row="0"
                                   HorizontalAlignment="Center"
                                   VerticalAlignment="Bottom"
                                   Foreground="White"
                                   Text="QTY" />
                        <TextBlock Grid.Row="1"
                                   Text="{Binding Quantity}"
                                   Margin="0,-5,0,0"
                                   FontSize="22"
                                   HorizontalAlignment="Center"
                                   Foreground="{StaticResource AWShopperItemSelectionColor}"></TextBlock>
                    </Grid>
                </Border>
            </Grid>
        </Grid>
    </DataTemplate>

    <DataTemplate x:Key="ShoppingCartItemTemplateMinimal">
        <Grid Width="270"
              Height="150"
              Background="{StaticResource AWShopperItemBackgroundBrush}">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="70" />
                <ColumnDefinition />
            </Grid.ColumnDefinitions>
            <Image Source="{Binding Image}"
                   Grid.Column="0"
                   Width="60"
                   Height="60"
                   Margin="5" />
            <Grid Grid.Column="1">
                <Grid.RowDefinitions>
                    <RowDefinition Height="45" />
                    <RowDefinition />
                    <RowDefinition Height="45" />
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition />
                    <ColumnDefinition Width="50" />
                </Grid.ColumnDefinitions>
                <TextBlock Text="{Binding Title}"
                           Grid.Row="0"
                           TextWrapping="Wrap"
                           Grid.ColumnSpan="2"
                           Margin="3"></TextBlock>
                <TextBlock Text="{Binding Description}"
                           Grid.Row="1"
                           FontSize="14"
                           Foreground="White"
                           Margin="3"
                           Grid.ColumnSpan="2"
                           TextWrapping="Wrap"
                           TextTrimming="WordEllipsis"></TextBlock>
                <Grid Grid.Row="2"
                      Grid.Column="0">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto" />
                        <ColumnDefinition />
                    </Grid.ColumnDefinitions>
                    <TextBlock Grid.Column="0"
                               Text="{Binding DiscountedPrice}"
                               Margin="3"
                               VerticalAlignment="Bottom"
                               FontSize="20"></TextBlock>
                    <Grid Grid.Column="1"
                          Height="25"
                          VerticalAlignment="Bottom">
                        <Line Stretch="Fill"
                              Stroke="Gray"
                              StrokeThickness="2"
                              X1="1"
                              VerticalAlignment="Center"
                              HorizontalAlignment="Center" />
                        <TextBlock Text="{Binding FullPrice}"
                                   Margin="3"
                                   VerticalAlignment="Bottom"
                                   HorizontalAlignment="Center"
                                   FontSize="12"
                                   Foreground="White"></TextBlock>
                    </Grid>
                </Grid>
                <Border Grid.Row="2"
                        Grid.Column="1"
                        Width="40"
                        Height="40"
                        CornerRadius="40"
                        Background="{StaticResource AWShopperItemDarkerBackgroundBrush}">
                    <Grid>
                        <Grid.RowDefinitions>
                            <RowDefinition />
                            <RowDefinition />
                        </Grid.RowDefinitions>
                        <TextBlock x:Uid="Quantity"
                                   Grid.Row="0"
                                   HorizontalAlignment="Center"
                                   FontSize="12"
                                   Foreground="White"
                                   Text="QTY" />
                        <TextBlock Grid.Row="1"
                                   Text="{Binding Quantity}"
                                   Margin="0,-5,0,0"
                                   FontSize="16"
                                   HorizontalAlignment="Center"
                                   Foreground="{StaticResource AWShopperItemSelectionColor}"></TextBlock>
                    </Grid>
                </Border>
            </Grid>
        </Grid>
    </DataTemplate>

    <DataTemplate x:Key="ShippingMethodTemplate">
        <Grid MinWidth="200"
              Height="80"
              Background="{StaticResource AWShopperItemBackgroundBrush}"
              AutomationProperties.Name="ShippingMethodMainGrid">
            <Grid.ColumnDefinitions>
                <ColumnDefinition />
                <ColumnDefinition Width="90" />
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition />
                <RowDefinition />
            </Grid.RowDefinitions>
            <TextBlock Text="{Binding Description}"
                       Grid.Row="0"
                       Grid.Column="0"
                       FontSize="26"
                       Margin="5,0"></TextBlock>
            <TextBlock Text="{Binding EstimatedTime}"
                       Grid.Row="1"
                       Foreground="White"
                       TextWrapping="Wrap"
                       Margin="5,15,5,5"></TextBlock>
            <TextBlock Text="{Binding Cost}"
                       Grid.Row="0"
                       Grid.Column="1"
                       Grid.RowSpan="2"
                       FontSize="26"
                       Foreground="White"
                       TextWrapping="Wrap"
                       Margin="3"></TextBlock>
        </Grid>
    </DataTemplate>

        <DataTemplate x:Key="ShippingMethodTemplateMinimal">
        <Grid MinWidth="200"
              Height="80"
              Background="{StaticResource AWShopperItemBackgroundBrush}"
              AutomationProperties.Name="ShippingMethodMainGrid">
            <Grid.ColumnDefinitions>
                <ColumnDefinition />
                <ColumnDefinition Width="90" />
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition />
                <RowDefinition />
            </Grid.RowDefinitions>
            <TextBlock Text="{Binding Description}"
                       Grid.Row="0"
                       Grid.Column="0"
                       FontSize="20"
                       Margin="5,0"></TextBlock>
            <TextBlock Text="{Binding EstimatedTime}"
                       Grid.Row="1"
                       Foreground="White"
                       TextWrapping="Wrap"
                       Margin="5,15,5,5"></TextBlock>
            <TextBlock Text="{Binding Cost}"
                       Grid.Row="0"
                       Grid.Column="1"
                       Grid.RowSpan="2"
                       FontSize="20"
                       Foreground="White"
                       TextWrapping="Wrap"
                       Margin="3"></TextBlock>
        </Grid>
    </DataTemplate>

    
    <DataTemplate x:Key="CheckoutDataTemplate">
        <Grid MinWidth="270"
              Height="130"
              Background="{StaticResource AWShopperItemBackgroundBrush}">
            <Grid Grid.Row="0">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition />
                    <ColumnDefinition Width="60" />
                </Grid.ColumnDefinitions>
                <Grid.RowDefinitions>
                    <RowDefinition Height="40" />
                    <RowDefinition Height="20" />
                    <RowDefinition Height="20" />
                    <RowDefinition />
                </Grid.RowDefinitions>
                <TextBlock Text="{Binding Title}"
                           Grid.Row="0"
                           Margin="5,0"
                           TextTrimming="WordEllipsis"
                           FontSize="26"></TextBlock>
                <TextBlock Text="{Binding FirstLine, Mode=TwoWay}"
                           Grid.Row="1"
                           Foreground="White"
                           Margin="5,0"></TextBlock>
                <TextBlock Text="{Binding SecondLine, Mode=TwoWay}"
                           Grid.Row="2"
                           Foreground="White"
                           Margin="5,0"></TextBlock>
                <TextBlock Text="{Binding BottomLine, Mode=TwoWay}"
                           Grid.Row="3"
                           Margin="5,20,0,0"
                           Foreground="White"
                           VerticalAlignment="Center"></TextBlock>
                <Image Source="{Binding LogoUri}"
                       Grid.Row="3"
                       Grid.Column="1"
                       Margin="0,10,15,0"
                       VerticalAlignment="Center" />
            </Grid>
        </Grid>
    </DataTemplate>

    <DataTemplate x:Key="SmallCheckoutDataTemplate">
        <Grid Width="390"
              Height="50"
              Background="{StaticResource AWShopperItemBackgroundBrush}">
            <Grid.RowDefinitions>
                <RowDefinition Height="25" />
                <RowDefinition Height="25" />
            </Grid.RowDefinitions>
            <TextBlock Text="{Binding FirstLine}"
                       Grid.Row="0"
                       Margin="10,5,0,0"
                       Foreground="White" />
            <TextBlock Text="{Binding SecondLine}"
                       Grid.Row="1"
                       Margin="10,0,0,0"
                       Foreground="White" />
        </Grid>
    </DataTemplate>

    <DataTemplate x:Key="CheckoutDataFlyoutTemplate">
        <StackPanel Margin="10">
            <TextBlock Text="{Binding FirstLine}"
                       Style="{StaticResource BodyTextBlockStyle}" />
            <TextBlock Text="{Binding SecondLine}"
                       Style="{StaticResource BodyTextBlockStyle}" />
            <TextBlock Text="{Binding BottomLine}"
                       Style="{StaticResource BodyTextBlockStyle}" />
        </StackPanel>
    </DataTemplate>

    <DataTemplate x:Key="ProductTemplate">
        <Grid MinWidth="420">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="*" />
            </Grid.ColumnDefinitions>
            <Border Background="{StaticResource ListViewItemPlaceholderBackgroundThemeBrush}"
                    BorderBrush="White"
                    BorderThickness="2"
                    Width="150"
                    Height="100">
                <Image Source="{Binding Image}"
                       Stretch="UniformToFill">
                    <Interactivity:Interaction.Behaviors>
                        <Core:IncrementalUpdateBehavior Phase="2"/>
                    </Interactivity:Interaction.Behaviors>
                </Image>
            </Border>
            <StackPanel Grid.Column="1"
                        Margin="10,-10,0,0" HorizontalAlignment="Stretch">
                <TextBlock Text="{Binding Title}"
                           Margin="5"
                           FontSize="25"
                           Height="Auto"
                           MaxHeight="80"
                           TextWrapping="Wrap"
                           TextTrimming="WordEllipsis">
                        <Interactivity:Interaction.Behaviors>
                            <Core:IncrementalUpdateBehavior Phase="1"/>
                        </Interactivity:Interaction.Behaviors>
                </TextBlock>
                <TextBlock Text="{Binding SalePrice}"
                           Style="{StaticResource BodyTextStyle}"
                           Margin="5"
                           FontSize="32"
                           FontWeight="ExtraBold">
                        <Interactivity:Interaction.Behaviors>
                            <Core:IncrementalUpdateBehavior Phase="2"/>
                        </Interactivity:Interaction.Behaviors>
                </TextBlock>
            </StackPanel>
        </Grid>
    </DataTemplate>

    <DataTemplate x:Key="ProductTemplateMinimal">
        <Grid Margin="6,0" Width="400" Height="90">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="*" />
            </Grid.ColumnDefinitions>
            <Border Background="{StaticResource ListViewItemPlaceholderBackgroundThemeBrush}"
                    BorderBrush="White"
                    BorderThickness="2"
                    Width="80"
                    Height="55"
                    Margin="0,10">
                <Image Source="{Binding Image}"
                       Stretch="UniformToFill">
                    <Interactivity:Interaction.Behaviors>
                        <Core:IncrementalUpdateBehavior Phase="2"/>
                    </Interactivity:Interaction.Behaviors>                    
                </Image>
            </Border>
            <StackPanel Grid.Column="1"
                        Margin="10,0,0,0">
                <TextBlock Margin="5"
                           FontSize="20"
                           Height="Auto"
                           MaxHeight="60"
                           Text="{Binding Title}"
                           TextWrapping="Wrap"
                           TextTrimming="WordEllipsis">
                    <Interactivity:Interaction.Behaviors>
                        <Core:IncrementalUpdateBehavior Phase="1"/>
                    </Interactivity:Interaction.Behaviors>                    
                </TextBlock>
                <TextBlock Text="{Binding SalePrice}"
                           Style="{StaticResource BodyTextStyle}"
                           Margin="5"
                           FontSize="27"
                           FontWeight="ExtraBold">
                    <Interactivity:Interaction.Behaviors>
                        <Core:IncrementalUpdateBehavior Phase="2"/>
                    </Interactivity:Interaction.Behaviors>                    
                </TextBlock>
            </StackPanel>
        </Grid>
    </DataTemplate>
</ResourceDictionary>
